package fr.charlott.batch.mapper;

import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;

import fr.charlott.core.repository.model.Categorie;

public class CategorieFieldSetMapper implements FieldSetMapper<Categorie> {

    @Override
    public Categorie mapFieldSet(FieldSet fieldSet) throws BindException {
        Categorie categorie = new Categorie();
        categorie.setNom(fieldSet.readString("nom"));
        return categorie;
    }

}
